/* 
 * Copyright (C) 2012 UTSChedule
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package utsc.apps.utschedule.classes;

import android.content.Intent;

import com.j256.ormlite.field.DatabaseField;

/**
 * This is a generic class for all event type objects.<br/>
 * Any event type objects should extend from this class.
 * 
 * @author 
 * 
 */
public class GenericEvent {

	// db field constants
	public static String STARTTIME="_startTime";
	public static String ENDTIME="_endTime";
	public static String LOCATION="_location";
	public static String TITLE="_title";
	
	@DatabaseField
	private long _startTime;
	@DatabaseField
	private long _endTime;
	@DatabaseField
	private String _location;
	@DatabaseField
	private String _title;

	public GenericEvent() {
		super();
		_startTime = 0;
		_endTime = 0;
	}

	public GenericEvent(Intent intent){
		_startTime=intent.getLongExtra(STARTTIME, 0);
		_endTime=intent.getLongExtra(ENDTIME, 0);
		_location=intent.getStringExtra(LOCATION);
		_title=intent.getStringExtra(TITLE);
	}
	
	/**
	 * @param _startTime
	 * @param _endTime
	 */
	public GenericEvent(long _startTime, long _endTime) {
		this(_startTime, _endTime, "", "");
	}

	/**
	 * @param _startTime
	 * @param _endTime
	 * @param _location
	 * @param _title
	 */
	public GenericEvent(long _startTime, long _endTime, String _location, String _title) {
		this._startTime = _startTime;
		this._endTime = _endTime;
		this._location = _location;
		this._title = _title;
	}

	public long get_endTime() {
		return _endTime;
	}

	public long get_startTime() {
		return _startTime;
	}

	public void set_endTime(long _endTime) {
		this._endTime = _endTime;
	}

	public void set_startTime(long _startTime) {
		this._startTime = _startTime;
	}

	public String get_location() {
		return _location;
	}

	public void set_location(String _location) {
		this._location = _location;
	}

	public String get_title() {
		return _title;
	}

	public void set_title(String _title) {
		this._title = _title;
	}

}
